Notice
This is fork of hidapi-rs
.
hidapi-rs
is wrapper of hidapi
.
Due to the effect of hidapi's Issue, latest hidapi-rs
can't open multiple JoyCons on macOS.
The pull request for bug fixes has not yet been merged.
This repository provides hidapi-rs
with its modified hidapi
fork.
hidapi
This crate provides a rust abstraction over the features of the C library hidapi. Based off of hidapi-rs by Osspial.
Usage
This crate is on crates.io and can be
used by adding hidapi
to the dependencies in your project's Cargo.toml
.
Example
extern crate hidapi;
let api = new.unwrap;
// Print out information about all connected devices
for device in api.devices
// Connect to device using its VID and PID
let = ;
let device = api.open.unwrap;
// Read data from device
let mut buf = ;
let res = device.read.unwrap;
println!;
// Write data to device
let buf = ;
let res = device.write.unwrap;
println!;
Documentation
Available at docs.rs.